<!doctype html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<button id="btn">按    钮</button>
<script>
var button = document.getElementById("btn");
button.onclick = function(e){
    var e = e || window.event;						//兼容标准模型和IE模型的Event获取方式
    document.write(e.srcElement ? e.srcElement : e.target);	//兼容标准模型和IE模型的Event属性
}
</script> 
</body>
</html>
